<template>
   <div class="home">
      <a-button type="primary" @click="doLogin">登录</a-button>
   </div>
</template>

<script lang="ts">
   import {Component, Vue} from 'vue-property-decorator'
   import {Action} from "vuex-class"

   @Component
   export default class Home extends Vue {
      @Action('handleLogin') handleLogin: Function

      doLogin() {
         this.handleLogin({userName: '13564540022', password: '222222'}).then((res: Ajax.AjaxResponse) => {
            this.$message.success('登录成功')
            console.log('res', res.data)
         }).catch((error: object) => {
            this.$message.error(error)
         })
      }
   }
</script>

<style scoped>

</style>
